import request from "@/utils/request";

// 查询商品管理列表
export function listGoods(query) {
  return request({
    url: "/shop/goods/list",
    method: "get",
    params: query,
  });
}

// 查询商品管理详细
export function getGoods(id) {
  return request({
    url: "/shop/goods/info",
    method: "get",
    params: { id: id },
  });
}

// 新增商品管理
export function addGoods(data) {
  return request({
    url: "/shop/goods",
    method: "post",
    data: data,
  });
}

// 修改商品管理
export function updateGoods(data) {
  return request({
    url: "/shop/goods",
    method: "put",
    data: data,
  });
}

// 删除商品管理
export function delGoods(id) {
  return request({
    url: "/shop/goods/" + id,
    method: "delete",
  });
}

// 导出商品管理
export function exportGoods(query) {
  return request({
    url: "/shop/goods/export",
    method: "get",
    params: query,
  });
}

// 查询商品分类列表
export function listShopType(query) {
  return request({
    url: "/shop/goods/listClassify",
    method: "get",
    params: query,
  });
}

// 查询乡镇列表
export function listTown(query) {
  return request({
    url: "/shop/goods/listTownShip",
    method: "get",
    params: query,
  });
}

// 获取乡镇下村
export function listTownVillage(query) {
  return request({
    url: "/shop/goods/getVillageMsg",
    method: "get",
    params: query,
  });
}

//是否开启支付功能
export function listPayFun(query) {
  return request({
    url: "/shop/functionMenu/getPayFun",
    method: "get",
    params: query,
  });
}

//是否开启支付功能
export function editPayFun(data) {
  return request({
    url: "/shop/functionMenu/editPayFun",
    method: "put",
    data: data,
  });
}
